x86/traps: widen condition for logging top-of-stack
authorJan Beulich <jbeulich@suse.com>
Tue, 24 Sep 2019 08:48:44 +0000 (10:48 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 24 Sep 2019 08:48:44 +0000 (10:48 +0200)
commit445891bb8ea77ebc9bee98c4507b077d96928521
treefe64f91b2a5a1705c0cf057fd59de70a9a73568d
parent22c419eec6e037a0f8234be97a5ee057bdc89ee4
x86/traps: widen condition for logging top-of-stack

Despite -fno-omit-frame-pointer the compiler may omit the frame pointer,
often for relatively simple leaf functions. (To give a specific example,
the case I've run into this with is _pci_hide_device() and gcc 8.
Interestingly the even more simple neighboring iommu_has_feature() does
get a frame pointer set up, around just a single instruction. But this
may be a result of the size-of-asm() effects discussed elsewhere.)

Log the top-of-stack value if it looks valid _or_ if RIP looks invalid.

Also annotate all stack trace entries with a marker, to indicate their
origin:
R: register state
F: frame pointer based
S: raw stack contents

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/traps.c